from apps.common.base.views import *
from apps.system.learn.serializers import *
from apps.system.learn.dao import LearnDao
from apps.system.learn.filters import LearnFilter

class BaseLearnViewSet(BaseViewSet):
    serializer_class = LearnModelSerializer
    filter_class = LearnFilter
    DAO_CLASS = LearnDao
    serializer_class_export = LearnModelSerializer

    exportFieldList = [
        {'type': 'String', 'key': 'id', 'showName': 'ID', 'width': 2000,},
        {'type': 'String', 'key': 'name', 'showName': '名称', 'width': 4000,},
        {'type': 'Record', 'key': 'user', 'showName': '用户', 'width': 2000, 'relatedModel': 'userModel', 'relatedKey': 'username'},
        {'type': 'String', 'key': 'statusLabel', 'showName': '状态', 'width': 2000,},
        {'type': 'Switch', 'key': 'isShow', 'showName': '是否显示', 'width': 2000,},
        {'type': 'Datetime', 'key': 'createTime', 'showName': '创建时间', 'width': 6000, 'format': '%Y-%m-%d %H:%M:%S'}
    ]
